home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Borland / Borland C++ V5.02 / BARSDI.PAK / GLOBALS.H < prev    next >
C/C++ Source or Header  |  1997-05-06  |  6KB  |  162 lines

  1. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 
  2. // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 
  3. // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 
  4. // PARTICULAR PURPOSE.
  5. //
  6. // Copyright (C) 1993-1995 Microsoft Corporation.  All Rights Reserved.
  7. //
  8. // PURPOSE:
  9. //
  10. //  Contains declarations for all globally scoped names in the program
  11. //
  12.  
  13. //
  14. // Product identifier string defines
  15. //
  16. //  **TODO** Change these strings to the name of your application.
  17.  
  18. #define APPNAME  BARSDI
  19. #define ICONFILE BARSDI.ICO
  20. #define SZAPPNAME "BARSDI"
  21. #define SZDESCRIPTION "Toolbar/Statusbar Sample"
  22. #define SZABOUT "About BARSDI"
  23. #define SZVERSION "4.0"
  24.  
  25. //-------------------------------------------------------------------------
  26. // Functions for handling main window messages.  The message-dispatching
  27. // mechanism expects all message-handling functions to have the following
  28. // prototype:
  29. //
  30. //     LRESULT FunctionName(HWND, UINT, WPARAM, LPARAM);
  31.  
  32. // **TODO**  Add message-handling function prototypes here.  Be sure to
  33. //           add the function names to the main window message table in
  34. //           barsdi.c.
  35.  
  36. LRESULT MsgCommand   (HWND, UINT, WPARAM, LPARAM);
  37. LRESULT MsgCreate    (HWND, UINT, WPARAM, LPARAM);
  38. LRESULT MsgDestroy   (HWND, UINT, WPARAM, LPARAM);
  39. LRESULT MsgSize      (HWND, UINT, WPARAM, LPARAM);
  40. LRESULT MsgTimer     (HWND, UINT, WPARAM, LPARAM);
  41. LRESULT MsgMousemove (HWND, UINT, WPARAM, LPARAM);
  42. LRESULT MsgMenuSelect(HWND, UINT, WPARAM, LPARAM);
  43. LRESULT MsgNotify    (HWND, UINT, WPARAM, LPARAM);
  44.  
  45.  
  46. //-------------------------------------------------------------------------
  47. // Functions for handling main window commands--ie. functions for
  48. // processing WM_COMMAND messages based on the wParam value.
  49. // The message-dispatching mechanism expects all command-handling
  50. // functions to have the following prototype:
  51. //
  52. //     LRESULT FunctionName(HWND, WORD, WORD, HWND);
  53.  
  54. // **TODO**  Add message-handling function prototypes here.  Be sure to
  55. //           add the function names to the main window command table in
  56. //           barsdi.c.
  57.  
  58. LRESULT CmdExit (HWND, WORD, WORD, HWND);
  59. LRESULT CmdAbout(HWND, WORD, WORD, HWND);
  60. LRESULT CmdStub (HWND, WORD, WORD, HWND);
  61.  
  62.  
  63. //-------------------------------------------------------------------------
  64. // Global function prototypes.
  65.  
  66. // **TODO**  Add global function prototypes here.
  67.  
  68. BOOL InitApplication(HINSTANCE, int);
  69. BOOL CenterWindow(HWND, HWND);
  70.  
  71.     // Callback functions.  These are called by Windows.
  72.  
  73. // **TODO**  Add new callback function prototypes here.
  74.  
  75. LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
  76.  
  77.  
  78. // -----------------------------------------------------------------------
  79. // Global Variable declarations
  80. //
  81.  
  82. extern HINSTANCE hInst;     // The current instance
  83. extern char szAppName[];    // The name of this application
  84. extern char szTitle[];      // The title bar text
  85.  
  86. // **TODO**  For NON-MDI applications, uncomment line 1 below and comment
  87. //           line 2.  For MDI applications, uncomment line 2 below, comment
  88. //           line 1, and then define hwndMDIClient as a global variable in
  89. //           INIT.C
  90. #define hwndMDIClient NULL        /* (1) Stub for NON-MDI applications. */
  91. // extern HWND hwndMDIClient;     /* (2) For MDI applications.          */
  92.  
  93.  
  94. //-------------------------------------------------------------------------
  95. // Message and command dispatch infrastructure.  The following type
  96. // definitions and functions are used by the message and command dispatching
  97. // mechanism and do not need to be changed.
  98.  
  99.     // Function pointer prototype for message handling functions.
  100. typedef LRESULT (*PFNMSG)(HWND,UINT,WPARAM,LPARAM);
  101.  
  102.     // Function pointer prototype for command handling functions.
  103. typedef LRESULT (*PFNCMD)(HWND,WORD,WORD,HWND);
  104.  
  105.     // Enumerated type used to determine which default window procedure
  106.     // should be called by the message- and command-dispatching mechanism
  107.     // if a message or command is not handled explicitly.
  108. typedef enum
  109. {
  110.    edwpNone,            // Do not call any default procedure.
  111.    edwpWindow,          // Call DefWindowProc.
  112.    edwpDialog,          // Call DefDlgProc (This should be used only for
  113.                         // custom dialogs - standard dialog use edwpNone).
  114.    edwpMDIChild,        // Call DefMDIChildProc.
  115.    edwpMDIFrame         // Call DefFrameProc.
  116. } EDWP;                // Enumeration for Default Window Procedures
  117.  
  118.     // This structure maps messages to message handling functions.
  119. typedef struct _MSD
  120. {
  121.     UINT   uMessage;
  122.     PFNMSG pfnmsg;
  123. } MSD;                 // MeSsage Dispatch structure
  124.  
  125.     // This structure contains all of the information that a window
  126.     // procedure passes to DispMessage in order to define the message
  127.     // dispatching behavior for the window.
  128. typedef struct _MSDI
  129. {
  130.     int  cmsd;          // Number of message dispatch structs in rgmsd
  131.     MSD *rgmsd;         // Table of message dispatch structures
  132.     EDWP edwp;          // Type of default window handler needed.
  133. } MSDI, FAR *LPMSDI;   // MeSsage Dipatch Information
  134.  
  135.     // This structure maps command IDs to command handling functions.
  136. typedef struct _CMD
  137. {
  138.     WORD   wCommand;
  139.     PFNCMD pfncmd;
  140. } CMD;                 // CoMmand Dispatch structure
  141.  
  142.     // This structure contains all of the information that a command
  143.     // message procedure passes to DispCommand in order to define the
  144.     // command dispatching behavior for the window.
  145. typedef struct _CMDI
  146. {
  147.     int  ccmd;          // Number of command dispatch structs in rgcmd
  148.     CMD *rgcmd;         // Table of command dispatch structures
  149.     EDWP edwp;          // Type of default window handler needed.
  150. } CMDI, FAR *LPCMDI;   // CoMmand Dispatch Information
  151.  
  152.     // Message and command dispatching functions.  They look up messages
  153.     // and commands in the dispatch tables and call the appropriate handler
  154.     // function.
  155. LRESULT DispMessage(LPMSDI, HWND, UINT, WPARAM, LPARAM);
  156. LRESULT DispCommand(LPCMDI, HWND, WPARAM, LPARAM);
  157.  
  158.     // Message dispatch information for the main window
  159. extern MSDI msdiMain;
  160.     // Command dispatch information for the main window
  161. extern CMDI cmdiMain;
  162.